package org.jivesoftware.smack.filter;

import org.jivesoftware.smack.packet.Packet;

public class FromContainsFilter
  implements PacketFilter
{
  private String from;

  public FromContainsFilter(String paramString)
  {
    if (paramString == null)
      throw new IllegalArgumentException("Parameter cannot be null.");
    this.from = paramString.toLowerCase();
  }

  public boolean accept(Packet paramPacket)
  {
    int i;
    if (paramPacket.getFrom() == null)
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        if (paramPacket.getFrom().toLowerCase().indexOf(this.from) == -1)
          break;
        i = 1;
      }
      i = 0;
    }
  }
}